import React from "react";
import { Navigate } from "react-router-dom";

const Auth = (props) => {
  if (localStorage.getItem("token")) {
    return props.children;
  } else {
    return <Navigate to="/home"></Navigate>;
  }
};

export default Auth;
